package us.wili.dev.netty.model.potodto;

import us.wili.dev.model.entity.Game;
import us.wili.dev.netty.model.game.Room;

public class GameToRoom {

    public static Room copyGameToRoom(Game game,Room room){
        if (game!=null&&room!=null){
            room.setType(game.getType());
            String []blinds= game.getBlinds().split("/");
            if (blinds.length==2){
                room.setSmallBet(Integer.parseInt(blinds[0]));
                room.setBigBet(Integer.parseInt(blinds[1]));
            }else {
                room.setSmallBet(1);
                room.setBigBet(2);
            }
            room.setMaxChips(game.getScoreboard()*game.getScoreboardTimes());
            room.setMinChips(game.getScoreboard());

        }
        return room;
    }
}
